package com.xiaolun.birdge;
//抽线的电脑类
public abstract class Computer {
    //组合，品牌，搭建的桥梁（电脑类型中放置品牌）
    protected Brand brand;

    public Computer(Brand brand) {
        this.brand = brand;
    }

    public void info(){
        //品牌输出
        brand.info();
    }
}

class Deskktop extends Computer{

    public Deskktop(Brand brand) {
        super(brand);
    }

    //重写父类方法
    @Override
    public void info() {
        super.info();
        //类型输出
        System.out.println("台式机");
    }
}

class Laptop extends Computer{

    public Laptop(Brand brand) {
        super(brand);
    }

    //重写父类方法
    @Override
    public void info() {
        super.info();
        System.out.println("笔记本");
    }
}